package com.region.plugin;

/**
 * Interceptor Proxy Manager
 *
 * @author liujieyu
 * @date 2023/5/23 20:31
 * @desciption
 */
public final class InterceptorProxyManager extends AbstractProxyManager {

    private static InterceptorProxyManager INSTANCE;

    private InterceptorProxyManager(boolean enableLoader) {
        super(enableLoader);
    }

    /**
     * Get the global instance
     *
     * @return
     */
    public static InterceptorProxyManager getInstance() {
        return getInstance(false);
    }
    /**
     * Get the global instance with enable
     *
     * @return
     */
    public static InterceptorProxyManager getInstance(boolean enable) {
        if (INSTANCE != null) {
            return INSTANCE;
        }
        synchronized (InterceptorProxyManager.class) {
            if (INSTANCE == null) {
                INSTANCE = getNewInstance(enable);
                return INSTANCE;
            }
        }
        return INSTANCE;
    }
    /**
     * Get a local instance
     *
     * @return
     */
    public static InterceptorProxyManager getNewInstance() {
        return getNewInstance(false);
    }

    /**
     * Get a local instance with load spi
     *
     * @return
     */
    public static InterceptorProxyManager getNewInstance(boolean enable) {
        return new InterceptorProxyManager(enable);
    }
}
